package com.account.web;

import com.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author gongsl
 */
@RestController
@RequestMapping("account")
public class AccountController {

    @Autowired
    private AccountService accountService;

    /**
     * 扣款
     * @param userId
     * @param money
     * @return
     */
    @PostMapping("/{userId}/{money}")
    public void deduct(@PathVariable("userId") String userId,
                           @PathVariable("money") Integer money){
        accountService.deduct(userId, money);
    }
}
